#include<iostream>
using namespace std;
#include<fstream>

class Solution
{
public:
    //M,N:矩阵规模 x,y:当前坐标 k:剩余步数 return:合法走法
    int myRec(int M,int N,int x,int y,int k)
    {
        if(x < 0 || x >= M || y < 0 || y >= N) {
            return 0;
        } 
        if(k == 0) {
            return 1;
        }
        return myRec(M,N,x-1,y,k-1)
            + myRec(M,N,x+1,y,k-1)
            + myRec(M,N,x,y-1,k-1)
            + myRec(M,N,x,y+1,k-1);
    }
    int mydp(int M,int N,int x,int y,int k) {
        //和象棋跳马一样,整个体k层依赖k-1层
    }
};

ifstream in("in.txt");
int main() {
    int M,N,x,y,k;
    in >> M >> N >> x >> y >> k;
    int ret = Solution().myRec(M,N,x,y,k);
    cout << "ret:" << ret << endl;
    return 0;
}